package cn.schoolwow.util.test.module.check.jsonarray.flow;

import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

public class InitialCheckJSONArrayDataFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        JSONArray optionArray = new JSONArray();

        {
            JSONObject option = new JSONObject();
            option.put("label", "未开始");
            option.put("value", "0");
            optionArray.add(option);
        }
        {
            JSONObject option = new JSONObject();
            option.put("label", "进行中");
            option.put("value", "1");
            optionArray.add(option);
        }
        {
            JSONObject option = new JSONObject();
            option.put("label", "已完成");
            option.put("value", "2");
            optionArray.add(option);
        }
        flowContext.putTemporaryData("optionArray", optionArray);
    }

    @Override
    public String name() {
        return "初始化JSONArray数组";
    }
}
